package com.itheima.enumDemo;

public class test2
{
    //枚举做信息标志和分类：参数值受枚举约束
    public static void main(String[] args) {
        move(Constant.UP);

    }
    public static void move(Constant c)
    {
        switch (c)
        {
            case Constant.UP:
                System.out.println("向上");
                break;
            case Constant.DOWN:
                System.out.println("向下");
                break;
            case Constant.LEFT:
                System.out.println("向左");
                break;
            case Constant.RIGHT:
                System.out.println("向右");
                break;
        }
    }
}
